package com.learning.java.optimize.id.generate.snow;

import com.learning.java.optimize.id.generate.IIdService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * ClassName: SnowflakeServiceImpl
 * Description: Twitter_Snowflake实现
 * Date: 2020/4/1 15:54 【需求编号】
 *
 * @author Sam Sho
 * @version V1.0.0
 */
@Slf4j
@Service("snowflakeServiceImpl")
public class SnowflakeServiceImpl implements IIdService {

    @Autowired
    private SnowflakeIdWorker snowflakeIdWorker;


    @Override
    public void createId() {
        System.out.println("insert into order_id(id) values('" + snowflakeIdWorker.nextId() + "');");
    }
}
